package BookManager;
// 第三页

import BookManager.operation.IOperation;

import java.util.Arrays;

//通过一个user对象，表示一个user表中的记录
//与user表中一一对应
abstract public class User {
    //用户ID
    private int userId;

    //用户名
    private String name;

    //用户密码
    private String password;


    //来表示操作的数组
    IOperation[] iOperation;

    public void doOperation(int choice){
        iOperation[choice].work();
    }

    public abstract int menu();

    //1
    public int getUserId() {
        return userId;
    }
    //2
    public void setUserId(int userId) {
        this.userId = userId;
    }
    //3
    public String getName() {
        return name;
    }
    //4
    public void setName(String name) {
        this.name = name;
    }
    //5
    public String getPassword() {
        return password;
    }
    //6
    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", iOperation=" + Arrays.toString(iOperation) +
                '}';
    }
}
